<template>
  <div class="down">
    <div class="down-center">
      <div class="down-center-title">
        福音
      </div>
      <div class="down-center-con">
        电商
      </div>
      <div class="down-center-btn" @click="down">
        立即下载
      </div>
    </div>
  </div>
</template>

<script>

export default {

  data () {
    return {
      ios: true
    }
  },
  created () {
    let u = navigator.userAgent
    let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 //g
    let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
    if (isAndroid) {
      this.ios = false
    }
    else if (isIOS) {
      this.ios = true
    }
  },
  methods: {
    down () {
      // ios
      if (this.ios) {
        window.location.href = "https://www.pgyer.com/YSMalliOS"
      }
      // 安卓
      else {
        window.location.href = "https://www.pgyer.com/YSMallAndroid"
      }
    }
  },
}
</script>
<style lang="less">
.down {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  &-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    &-title {
      font-size: 22px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #363636;
    }
    &-con {
      font-size: 14px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #363636;
    }
    &-btn {
      width: 135px;
      height: 44px;
      line-height: 44px;
      background: #026a3c;
      border-radius: 22px;

      font-size: 16px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #ffffff;
      text-align: center;
      margin-top: 35px;
    }
  }
}
</style>

